#!/bin/bash
# startPolicies <machineId> <N>

let s=16/$2
let startIdx=$1*$s
for (( i=0; i<$s; i++ ))
do
	let j=$i+$startIdx
	if [[ $j%2 -eq 0 ]]; then
		let pi=$j*100+60
		let pi1=$pi+100
		let j1=$j+1
		com="startUser "$pi" "$pi1" &"
		echo $com
		eval $com
		sleep 5
		com="startPolicy "$j" 1 60"
		echo $com
		eval $com
		sleep 5
		com="startPolicy "$j1" 1 60"
		echo $com
		eval $com
		sleep 5
	fi
done
